home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 05.zip
/
BS1 part 5
/
PDraw3.0.adf
/
pdraw_rex.lzh
/
StyleTagDelete.pdrx
< prev
next >
Wrap
Text File
|
1992-06-15
|
1KB
|
74 lines
/*
@N
This Genie will delete a previously defined style
*/
cr = '0a'x
styledb = "S:PDStyles.db"
if ~open(file, styledb, "r") then
exit_msg("No styles have been defined. Used AddStyleTag Genie to create a style tag.")
lines = ''
counter = 0
call pdm_ShowStatus("Reading style database..")
do while ~eof(file)
line = strip(readln(file))
if line = '' then iterate
parse var line stylename '@' .
lines = lines || cr || stylename
counter = counter + 1
linevals.counter.0 = stylename
linevals.counter.1 = line
end
call close(file)
if counter = 0 then
exit_msg("No styles have been defined. Used AddStyleTag Genie to create a style tag.")
lines = substr(lines,2)
nlines = min(max(counter, 5), 10)
stylename = pdm_SelectFromList("Select style to delete..", 30, nlines, 0, lines)
if stylename = '' then exit_msg()
output = ''
do i = 1 to counter
if linevals.i.0 ~= stylename then output = output || cr || linevals.i.1
end
if ~open(file, styledb, "w") then
exit_msg("Unable to upon the Style data base for writing!!")
output = substr(output, 2)
call writeln(file, output)
call close(file)
exit_msg()
exit_msg: procedure
do
parse arg message
if message ~= '' then call pdm_inform(1,message,)
call pdm_SetBatchMode(0)
call pdm_ClearStatus()
call pdm_AutoUpdate(1)
exit
end